package View;

import java.awt.event.ActionListener;
import javax.swing.JFrame;

public class OrderView extends JFrame{
    private OrderMainPanel orderMainPanel;
    
    //constructor
    public OrderView(){
        orderMainPanel = new OrderMainPanel();
        this.add(orderMainPanel);
        this.setDefaultCloseOperation(HIDE_ON_CLOSE);
        this.setSize(600, 400);
        this.setLocationRelativeTo(null);//center of screen
    }
    
    //If the orderMainPanel.newOrderB Button is clicked execute a method
    //in the OrderController named actionPerformed
    public void addNewOrderButtonListener(ActionListener listenForNewOrderButton){
        orderMainPanel.getNewOrderB().addActionListener(listenForNewOrderButton);
    }
    
}
